{% extends 'ui/base-form.html' %}

{% load url from future %}
{% load icons %}

{% block formbuttons %}

<div class="control-group pull-right">
  <a class="btn btn-inverse pull-right
    {% if deploy_disable_reason %} disabled {% endif %}"
    {% if not deploy_disable_reason %} href="../deploy/{{ device.id }}" {% endif %}
  >
    {% icon 'fugue-wand-hat' %}&nbsp;Deploy
  </a>
  {% if deploy_disable_reason %}
  <div class="help-block">
    <div class="pull-right" style="text-align:right">
      {{ deploy_disable_reason }}<br>
      {% block trans %}
        To enable deploy, click <a href="../asset/{{ device.id }}">here</a>
        to correct this.
      {% endblock %}
    </div>
  </div>
  {% endif %}
</div>
<div class="control-group {% if form.save_comment.errors %}error{% endif %}">
  <div class="input-append">{{ form.save_comment }}<button
      class="btn btn-primary"
      type="submit"
      name="devicesave">{% icon 'fugue-tick' %}&nbsp;Save
    </button>
  </div>
  {% for e in form.save_comment.errors %}
  <div class="help-block error-text">{{ e }}</div>
  {% empty %}
  <div class="help-block">{{ form.save_comment.help_text }}</div>
  {% endfor %}
</div>
{% endblock %}
